package com.example.designPatten.observer.ObserverSingle;

import com.example.designPatten.observer.ObserverSingle.inter.DisplayElement;
import com.example.designPatten.observer.ObserverSingle.inter.Observer;
import com.example.designPatten.observer.ObserverSingle.inter.Subject;

/**
* @Title:   []
* @Description: 
* @Date : 2016年4月20日下午4:56:37
* @Company: SI-TECH
* @author : LIJXD
* @version : 1.0
* @modify history
*  <p>修改日期    修改人   修改目的<p> 	
*/
public class CurrendConditionDiaplay implements Observer, DisplayElement {


	private float temperature;
	private float humidity;
	private Subject weatherData;
	
	
	
	public CurrendConditionDiaplay(Subject weatherData) {
		this.weatherData = weatherData;
		weatherData.registerObserver(this);
	}


	@Override
	public void display() {
		System.out.println("CurrendConditionDiaplay : temperature="+temperature+" , humidity="+humidity);
	}

 
	@Override
	public void update(float temperature, float humidity, float pressure) {
		this.temperature = temperature;
		this.humidity = humidity;
		display();
	}

}
